package com.test.practice.io.file;

import java.io.File;

/**
 * file
 *
 * @Description: File 演示
 * =======================
 * @Author: Jovi
 * =======================
 * @Date: Created in 2023-02-09
 * =======================
 * @Version: 1.1.2.0
 */
public class FileDemo {


    public static void main(String[] args) {

        m1();
    }

    /**
     * File三个构造函数
     */
    private static void m1() {
        //public File(String pathname)
        File file1 = new File("hello.txt");
        File file2 = new File("/Users/jovi/Documents/code/Practice/hello.txt");

        //public File(String parent,String child)
        File file3 = new File("/Users/jovi/Documents/code","/Practice");
        //public File(File parent,String child)
        File file4 = new File(file3, "hi.txt");

        System.out.println(file1);
        System.out.println(file2);
        System.out.println(file3);
        System.out.println(file4);
    }
}
